import { _decorator, Component, KeyCode } from 'cc';
const { ccclass } = _decorator;

@ccclass('ButtonKeyboardLink')
export class ButtonKeyboardLink extends Component {


    public onButtonClick(direction: string) {
        let keyCode: KeyCode;

        switch (direction) {
            case "up":
                keyCode = KeyCode.ARROW_UP;
                break;
            case "down":
                keyCode = KeyCode.ARROW_DOWN;
                break;
            case "left":
                keyCode = KeyCode.ARROW_LEFT;
                break;
            case "right":
                keyCode = KeyCode.ARROW_RIGHT;
                break;
            default:
                return;
        }
    }
} 
